﻿using UnityEngine;
using System.Collections;

public class GetFirstIndex : MonoBehaviour {

    public SkinnedMeshRenderer footRenderer;
    public SkinnedMeshRenderer headRenderer;
    public SkinnedMeshRenderer handRenderer;
    public SkinnedMeshRenderer upbodyRenderer;
    public SkinnedMeshRenderer lowerbodyRenderer;

	// Use this for initialization
	void Start () {
        GetIndex();
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void GetIndex()
    {
       int headIndex =  PlayerPrefs.GetInt("HeadIndex");
       int handIndex = PlayerPrefs.GetInt("HandIndex");
       int footIndex = PlayerPrefs.GetInt("FootIndex");
       int upbodyIndex = PlayerPrefs.GetInt("UpBodyIndex");
       int lowerbodyIndex = PlayerPrefs.GetInt("LowerIndex");

       footRenderer.sharedMesh = NewController.Zouni.footMeshArray[footIndex];
       headRenderer.sharedMesh = NewController.Zouni.headMeshArray[headIndex];
       handRenderer.sharedMesh = NewController.Zouni.handMeshArray[handIndex];
       upbodyRenderer.sharedMesh = NewController.Zouni.upbodyMeshArray[upbodyIndex];
       lowerbodyRenderer.sharedMesh = NewController.Zouni.lowerbodyMeshArray[lowerbodyIndex];

       footRenderer.material.color = NewController.Zouni.Yanse;
       headRenderer.material.color = NewController.Zouni.Yanse;
       handRenderer.material.color = NewController.Zouni.Yanse;
       upbodyRenderer.material.color = NewController.Zouni.Yanse;
       lowerbodyRenderer.material.color = NewController.Zouni.Yanse;

    }
}
